home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / C / ASAP / rastport.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-09-09  |  16.5 KB  |  389 lines

  1. /*****************************************************************************
  2.  *                                                                           *
  3.  * ASAP - Amiga Software Authoring Platform                                  *
  4.  *                                                                           *
  5.  * Written by Laurie Perrin                                                  *
  6.  *                                                                           *
  7.  * ARastPort wrapper class                                                   *
  8.  *                                                                           *
  9.  *****************************************************************************/
  10.  
  11. extern "C"
  12. {
  13.  #include <Proto/Graphics.h>
  14.  #include <Proto/GadTools.h>
  15.  #include <Proto/Intuition.h>
  16.  #include <Proto/Layers.h>
  17. }
  18.  
  19. class ARastPort : public RastPort
  20. {
  21.  public:
  22.  inline LONG AreaDraw(long x, long y);
  23.  inline LONG AreaEllipse(long xCenter, long yCenter, long a, long b);
  24.  inline LONG AreaEnd();
  25.  inline LONG AreaMove(long x, long y);
  26.  inline void AskFont(TextAttr * textAttr);
  27.  inline ULONG AskSoftStyle();
  28.  inline void BltPattern(PLANEPTR mask, long xMin, long yMin, long xMax, long yMax, unsigned long maskBPR);
  29.  inline void ClearEOL();
  30.  inline void ClearScreen();
  31.  inline void ClipBlit(long xSrc, long ySrc, RastPort * destRP, long xDest, long yDest, long xSize, long ySize, unsigned long minterm);
  32.  inline void DoCollision();
  33.  inline void Draw(long x, long y);
  34.  inline void DrawBevelBox(long left, long top, long width, long height, Tag tag1, ... );
  35.  inline void DrawBevelBoxA(long left, long top, long width, long height, TagItem * taglist);
  36.  inline void DrawBorder(Border * border, long leftOffset, long topOffset);
  37.  inline void DrawEllipse(long xCenter, long yCenter, long a, long b);
  38.  inline void DrawGList(ViewPort * vp);
  39.  inline void DrawImage(Image * image, long leftOffset, long topOffset);
  40.  inline void DrawImageState(Image * image, long leftOffset, long topOffset, unsigned long state, DrawInfo * drawInfo);
  41.  inline void EraseImage(Image * image, long leftOffset, long topOffset);
  42.  inline void EraseRect(long xMin, long yMin, long xMax, long yMax);
  43.  inline BOOL Flood(unsigned long mode, long x, long y);
  44.  inline ULONG GetAPen();
  45.  inline ULONG GetBPen();
  46.  inline ULONG GetDrMd();
  47.  inline ULONG GetOutlinePen();
  48.  inline void GetRPAttrs(unsigned long tag1Type, ... );
  49.  inline void GetRPAttrsA(TagItem * tags);
  50.  inline void InitRastPort();
  51.  inline void Move(long x, long y);
  52.  inline void PolyDraw(long count, WORD * polyTable);
  53.  inline void PrintIText(IntuiText * iText, long left, long top);
  54.  inline ULONG ReadPixel(long x, long y);
  55.  inline LONG ReadPixelArray8(unsigned long xstart, unsigned long ystart, unsigned long xstop, unsigned long ystop, UBYTE * array, RastPort * temprp);
  56.  inline LONG ReadPixelLine8(unsigned long xstart, unsigned long ystart, unsigned long width, UBYTE * array, RastPort * tempRP);
  57.  inline void RectFill(long xMin, long yMin, long xMax, long yMax);
  58.  inline void ReleaseGIRPort();
  59.  inline void ScrollRaster(long dx, long dy, long xMin, long yMin, long xMax, long yMax);
  60.  inline void ScrollRasterBF(long dx, long dy, long xMin, long yMin, long xMax, long yMax);
  61.  inline void SetABPenDrMd(unsigned long apen, unsigned long bpen, unsigned long drawmode);
  62.  inline void SetAPen(unsigned long pen);
  63.  inline void SetBPen(unsigned long pen);
  64.  inline void SetDrMd(unsigned long drawMode);
  65.  inline LONG SetFont(TextFont * textFont);
  66.  inline void SetMaxPen(unsigned long maxpen);
  67.  inline ULONG SetOutlinePen(unsigned long pen);
  68.  inline void SetRPAttrs(unsigned long tag1Type, ... );
  69.  inline void SetRPAttrsA(TagItem * tags);
  70.  inline void SetRast(unsigned long pen);
  71.  inline ULONG SetSoftStyle(unsigned long style, unsigned long enable);
  72.  inline ULONG SetWriteMask(unsigned long msk);
  73.  inline void SortGList();
  74.  inline void SwapBitsRastPortClipRect(ClipRect * cr);
  75.  inline LONG Text(STRPTR string, unsigned long count);
  76.  inline WORD TextExtent(STRPTR string, long count, struct TextExtent * textExtent);
  77.  inline ULONG TextFit(STRPTR string, unsigned long strLen, struct TextExtent * textExtent, struct TextExtent * constrainingExtent, long strDirection, unsigned long constrainingBitWidth, unsigned long constrainingBitHeight);
  78.  inline WORD TextLength(STRPTR string, unsigned long count);
  79.  inline void WriteChunkyPixels(unsigned long xstart, unsigned long ystart, unsigned long xstop, unsigned long ystop, UBYTE * array, long bytesperrow);
  80.  inline LONG WritePixel(long x, long y);
  81.  inline LONG WritePixelArray8(unsigned long xstart, unsigned long ystart, unsigned long xstop, unsigned long ystop, UBYTE * array, RastPort * temprp);
  82.  inline LONG WritePixelLine8(unsigned long xstart, unsigned long ystart, unsigned long width, UBYTE * array, RastPort * tempRP);
  83. };
  84. //----------------------------------------------------------------------------
  85. LONG ARastPort::AreaDraw (long x, long y)
  86. {
  87.  return ::AreaDraw(this, x, y);
  88. }
  89. //----------------------------------------------------------------------------
  90. LONG ARastPort::AreaEllipse (long xCenter, long yCenter, long a, long b)
  91. {
  92.  return ::AreaEllipse(this, xCenter, yCenter, a, b);
  93. }
  94. //----------------------------------------------------------------------------
  95. LONG ARastPort::AreaEnd ()
  96. {
  97.  return ::AreaEnd(this);
  98. }
  99. //----------------------------------------------------------------------------
  100. LONG ARastPort::AreaMove (long x, long y)
  101. {
  102.  return ::AreaMove(this, x, y);
  103. }
  104. //----------------------------------------------------------------------------
  105. void ARastPort::AskFont (TextAttr * textAttr)
  106. {
  107.  ::AskFont(this, textAttr);
  108. }
  109. //----------------------------------------------------------------------------
  110. ULONG ARastPort::AskSoftStyle ()
  111. {
  112.  return ::AskSoftStyle(this);
  113. }
  114. //----------------------------------------------------------------------------
  115. void ARastPort::BltPattern (PLANEPTR mask, long xMin, long yMin, long xMax, long yMax, unsigned long maskBPR)
  116. {
  117.  ::BltPattern(this, mask, xMin, yMin, xMax, yMax, maskBPR);
  118. }
  119. //----------------------------------------------------------------------------
  120. void ARastPort::ClearEOL ()
  121. {
  122.  ::ClearEOL(this);
  123. }
  124. //----------------------------------------------------------------------------
  125. void ARastPort::ClearScreen ()
  126. {
  127.  ::ClearScreen(this);
  128. }
  129. //----------------------------------------------------------------------------
  130. void ARastPort::ClipBlit (long xSrc, long ySrc, RastPort * destRP, long xDest, long yDest, long xSize, long ySize, unsigned long minterm)
  131. {
  132.  ::ClipBlit(this, xSrc, ySrc, destRP, xDest, yDest, xSize, ySize, minterm);
  133. }
  134. //----------------------------------------------------------------------------
  135. void ARastPort::DoCollision ()
  136. {
  137.  ::DoCollision(this);
  138. }
  139. //----------------------------------------------------------------------------
  140. void ARastPort::Draw (long x, long y)
  141. {
  142.  ::Draw(this, x, y);
  143. }
  144. //----------------------------------------------------------------------------
  145. void ARastPort::DrawBevelBox (long left, long top, long width, long height, Tag tag1, ... )
  146. {
  147.  DrawBevelBoxA(left, top, width, height, (TagItem *) &tag1);
  148. }
  149. //----------------------------------------------------------------------------
  150. void ARastPort::DrawBevelBoxA (long left, long top, long width, long height, TagItem * taglist)
  151. {
  152.  ::DrawBevelBoxA(this, left, top, width, height, taglist);
  153. }
  154. //----------------------------------------------------------------------------
  155. void ARastPort::DrawBorder (Border * border, long leftOffset, long topOffset)
  156. {
  157.  ::DrawBorder(this, border, leftOffset, topOffset);
  158. }
  159. //----------------------------------------------------------------------------
  160. void ARastPort::DrawEllipse (long xCenter, long yCenter, long a, long b)
  161. {
  162.  ::DrawEllipse(this, xCenter, yCenter, a, b);
  163. }
  164. //----------------------------------------------------------------------------
  165. void ARastPort::DrawGList (ViewPort * vp)
  166. {
  167.  ::DrawGList(this, vp);
  168. }
  169. //----------------------------------------------------------------------------
  170. void ARastPort::DrawImage (Image * image, long leftOffset, long topOffset)
  171. {
  172.  ::DrawImage(this, image, leftOffset, topOffset);
  173. }
  174. //----------------------------------------------------------------------------
  175. void ARastPort::DrawImageState (Image * image, long leftOffset, long topOffset, unsigned long state, DrawInfo * drawInfo)
  176. {
  177.  ::DrawImageState(this, image, leftOffset, topOffset, state, drawInfo);
  178. }
  179. //----------------------------------------------------------------------------
  180. void ARastPort::EraseImage (Image * image, long leftOffset, long topOffset)
  181. {
  182.  ::EraseImage(this, image, leftOffset, topOffset);
  183. }
  184. //----------------------------------------------------------------------------
  185. void ARastPort::EraseRect (long xMin, long yMin, long xMax, long yMax)
  186. {
  187.  ::EraseRect(this, xMin, yMin, xMax, yMax);
  188. }
  189. //----------------------------------------------------------------------------
  190. BOOL ARastPort::Flood (unsigned long mode, long x, long y)
  191. {
  192.  return ::Flood(this, mode, x, y);
  193. }
  194. //----------------------------------------------------------------------------
  195. ULONG ARastPort::GetAPen ()
  196. {
  197.  return ::GetAPen(this);
  198. }
  199. //----------------------------------------------------------------------------
  200. ULONG ARastPort::GetBPen ()
  201. {
  202.  return ::GetBPen(this);
  203. }
  204. //----------------------------------------------------------------------------
  205. ULONG ARastPort::GetDrMd ()
  206. {
  207.  return ::GetDrMd(this);
  208. }
  209. //----------------------------------------------------------------------------
  210. ULONG ARastPort::GetOutlinePen ()
  211. {
  212.  return ::GetOutlinePen(this);
  213. }
  214. //----------------------------------------------------------------------------
  215. void ARastPort::GetRPAttrs (unsigned long tag1Type, ... )
  216. {
  217.  GetRPAttrsA((TagItem *) &tag1Type);
  218. }
  219. //----------------------------------------------------------------------------
  220. void ARastPort::GetRPAttrsA (TagItem * tags)
  221. {
  222.  ::GetRPAttrsA(this, tags);
  223. }
  224. //----------------------------------------------------------------------------
  225. void ARastPort::InitRastPort ()
  226. {
  227.  ::InitRastPort(this);
  228. }
  229. //----------------------------------------------------------------------------
  230. void ARastPort::Move (long x, long y)
  231. {
  232.  ::Move(this, x, y);
  233. }
  234. //----------------------------------------------------------------------------
  235. void ARastPort::PolyDraw (long count, WORD * polyTable)
  236. {
  237.  ::PolyDraw(this, count, polyTable);
  238. }
  239. //----------------------------------------------------------------------------
  240. void ARastPort::PrintIText (IntuiText * iText, long left, long top)
  241. {
  242.  ::PrintIText(this, iText, left, top);
  243. }
  244. //----------------------------------------------------------------------------
  245. ULONG ARastPort::ReadPixel (long x, long y)
  246. {
  247.  return ::ReadPixel(this, x, y);
  248. }
  249. //----------------------------------------------------------------------------
  250. LONG ARastPort::ReadPixelArray8 (unsigned long xstart, unsigned long ystart, unsigned long xstop, unsigned long ystop, UBYTE * array, RastPort * temprp)
  251. {
  252.  return ::ReadPixelArray8(this, xstart, ystart, xstop, ystop, array, temprp);
  253. }
  254. //----------------------------------------------------------------------------
  255. LONG ARastPort::ReadPixelLine8 (unsigned long xstart, unsigned long ystart, unsigned long width, UBYTE * array, RastPort * tempRP)
  256. {
  257.  return ::ReadPixelLine8(this, xstart, ystart, width, array, tempRP);
  258. }
  259. //----------------------------------------------------------------------------
  260. void ARastPort::RectFill (long xMin, long yMin, long xMax, long yMax)
  261. {
  262.  ::RectFill(this, xMin, yMin, xMax, yMax);
  263. }
  264. //----------------------------------------------------------------------------
  265. void ARastPort::ReleaseGIRPort ()
  266. {
  267.  ::ReleaseGIRPort(this);
  268. }
  269. //----------------------------------------------------------------------------
  270. void ARastPort::ScrollRaster (long dx, long dy, long xMin, long yMin, long xMax, long yMax)
  271. {
  272.  ::ScrollRaster(this, dx, dy, xMin, yMin, xMax, yMax);
  273. }
  274. //----------------------------------------------------------------------------
  275. void ARastPort::ScrollRasterBF (long dx, long dy, long xMin, long yMin, long xMax, long yMax)
  276. {
  277.  ::ScrollRasterBF(this, dx, dy, xMin, yMin, xMax, yMax);
  278. }
  279. //----------------------------------------------------------------------------
  280. void ARastPort::SetABPenDrMd (unsigned long apen, unsigned long bpen, unsigned long drawmode)
  281. {
  282.  ::SetABPenDrMd(this, apen, bpen, drawmode);
  283. }
  284. //----------------------------------------------------------------------------
  285. void ARastPort::SetAPen (unsigned long pen)
  286. {
  287.  ::SetAPen(this, pen);
  288. }
  289. //----------------------------------------------------------------------------
  290. void ARastPort::SetBPen (unsigned long pen)
  291. {
  292.  ::SetBPen(this, pen);
  293. }
  294. //----------------------------------------------------------------------------
  295. void ARastPort::SetDrMd (unsigned long drawMode)
  296. {
  297.  ::SetDrMd(this, drawMode);
  298. }
  299. //----------------------------------------------------------------------------
  300. LONG ARastPort::SetFont (TextFont * textFont)
  301. {
  302.  return ::SetFont(this, textFont);
  303. }
  304. //----------------------------------------------------------------------------
  305. void ARastPort::SetMaxPen (unsigned long maxpen)
  306. {
  307.  ::SetMaxPen(this, maxpen);
  308. }
  309. //----------------------------------------------------------------------------
  310. ULONG ARastPort::SetOutlinePen (unsigned long pen)
  311. {
  312.  return ::SetOutlinePen(this, pen);
  313. }
  314. //----------------------------------------------------------------------------
  315. void ARastPort::SetRPAttrs (unsigned long tag1Type, ... )
  316. {
  317.  SetRPAttrsA((TagItem *) &tag1Type);
  318. }
  319. //----------------------------------------------------------------------------
  320. void ARastPort::SetRPAttrsA (TagItem * tags)
  321. {
  322.  ::SetRPAttrsA(this, tags);
  323. }
  324. //----------------------------------------------------------------------------
  325. void ARastPort::SetRast (unsigned long pen)
  326. {
  327.  ::SetRast(this, pen);
  328. }
  329. //----------------------------------------------------------------------------
  330. ULONG ARastPort::SetSoftStyle (unsigned long style, unsigned long enable)
  331. {
  332.  return ::SetSoftStyle(this, style, enable);
  333. }
  334. //----------------------------------------------------------------------------
  335. ULONG ARastPort::SetWriteMask (unsigned long msk)
  336. {
  337.  return ::SetWriteMask(this, msk);
  338. }
  339. //----------------------------------------------------------------------------
  340. void ARastPort::SortGList ()
  341. {
  342.  ::SortGList(this);
  343. }
  344. //----------------------------------------------------------------------------
  345. void ARastPort::SwapBitsRastPortClipRect (ClipRect * cr)
  346. {
  347.  ::SwapBitsRastPortClipRect(this, cr);
  348. }
  349. //----------------------------------------------------------------------------
  350. LONG ARastPort::Text (STRPTR string, unsigned long count)
  351. {
  352.  return ::Text(this, string, count);
  353. }
  354. //----------------------------------------------------------------------------
  355. WORD ARastPort::TextExtent (STRPTR string, long count, struct TextExtent * textExtent)
  356. {
  357.  return ::TextExtent(this, string, count, textExtent);
  358. }
  359. //----------------------------------------------------------------------------
  360. ULONG ARastPort::TextFit (STRPTR string, unsigned long strLen, struct TextExtent * textExtent, struct TextExtent * constrainingExtent, long strDirection, unsigned long constrainingBitWidth, unsigned long constrainingBitHeight)
  361. {
  362.  return ::TextFit(this, string, strLen, textExtent, constrainingExtent, strDirection, constrainingBitWidth, constrainingBitHeight);
  363. }
  364. //----------------------------------------------------------------------------
  365. WORD ARastPort::TextLength (STRPTR string, unsigned long count)
  366. {
  367.  return ::TextLength(this, string, count);
  368. }
  369. //----------------------------------------------------------------------------
  370. void ARastPort::WriteChunkyPixels (unsigned long xstart, unsigned long ystart, unsigned long xstop, unsigned long ystop, UBYTE * array, long bytesperrow)
  371. {
  372.  ::WriteChunkyPixels(this, xstart, ystart, xstop, ystop, array, bytesperrow);
  373. }
  374. //----------------------------------------------------------------------------
  375. LONG ARastPort::WritePixel (long x, long y)
  376. {
  377.  return ::WritePixel(this, x, y);
  378. }
  379. //----------------------------------------------------------------------------
  380. LONG ARastPort::WritePixelArray8 (unsigned long xstart, unsigned long ystart, unsigned long xstop, unsigned long ystop, UBYTE * array, RastPort * temprp)
  381. {
  382.  return ::WritePixelArray8(this, xstart, ystart, xstop, ystop, array, temprp);
  383. }
  384. //----------------------------------------------------------------------------
  385. LONG ARastPort::WritePixelLine8 (unsigned long xstart, unsigned long ystart, unsigned long width, UBYTE * array, RastPort * tempRP)
  386. {
  387.  return ::WritePixelLine8(this, xstart, ystart, width, array, tempRP);
  388. }
  389.